<template>
  <el-tree :data="data" nodeKey="key" :props="defaultProps" default-expand-all :height="700" show-checkbox />
</template>

<script>
  export default {
    data() {
      function dig(path = '0', level = 3) {
        const list = [];
        for (let i = 0; i < 10; i += 1) {
          const key = `${path}-${i}`;
          const treeNode = {
            title: key,
            key,
          };
          if (level > 0) {
            treeNode.children = dig(key, level - 1);
          }

          list.push(treeNode);
        }
        return list;
      }
      return {
        data: dig(),
        defaultProps: {
          children: 'children',
          label: 'title'
        }
      };
    }
  };
</script>

<style scoped>

</style>
